Fix assertion due to blocks
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 26 Feb 2019 16:20:41 +0000 (16:20 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Thu, 11 Jul 2019 06:39:38 +0000 (07:39 +0100)
commite52f431a5850c00cb1a8a29a81a27c77349fea72
treeb0d815dab0b0a5f74b3c9a18ecc80bea08dc6ab7
parent2fc1688d647f017fc3caf6c6f8cb6f82d7a81733
Fix assertion due to blocks

A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.

There is code

  Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
BlockExpr and returns nullptr, which causes isa to assert.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D58658

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354893 91177308-0d34-0410-b5e6-96231b3b80d8

Gbp-Pq: Name OpenCL-Fix-assertion-due-to-blocks.patch
clang/lib/AST/Expr.cpp
clang/test/CodeGenOpenCL/blocks.cl